/* 限制天 */
const disableDate = (time: Date) => {
  return time.getTime() < Date.now() - 8.64e7;
};

/* 限制小时 */
const disabledHour = () => {
  const arrs = [];
  for (let i = 0; i < 24; i++) {
    if (new Date().getHours() <= i) continue;
    arrs.push(i);
  }
  return arrs;
};

/* 限制分 */
const disabledMinute = () => {
  const arrs = [];
  for (let i = 0; i < 60; i++) {
    if (new Date().getMinutes() <= i) continue;
    arrs.push(i);
  }
  return arrs;
};

/* 限制秒 */
const disabledSecond = () => {
  const arrs = [];
  for (let i = 0; i < 60; i++) {
    if (new Date().getSeconds() <= i) continue;
    arrs.push(i);
  }
  return arrs;
};

export default {
  disableDate,
  disabledHour,
  disabledMinute,
  disabledSecond
};
